package com.atstudy.generic;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * @version v1.0
 * @description:
 * @author: admin
 * @date: 2023/1/3 15:09
 * @copyright: 博为峰
 */
public class GenericDemo01 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<String>();
        arrayList.add("a");
        arrayList.add("b");
//        arrayList.add(9);

//        Iterator iterator = arrayList.iterator();
        Iterator<String> iterator = arrayList.iterator();

        while (iterator.hasNext()) {
//            String str = (String) iterator.next();
            String str = iterator.next();
            System.out.println(str);
        }
    }
}
